/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.catosist.run.dataaccess.domain.hibernate;

import com.catosist.run.dataaccess.base.hibernate.HibernateGenericDAO;
import com.catosist.run.dataaccess.domain.ViajeDao;
import com.catosist.run.dataaccess.model.ViajeVO;
import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;

/**
 *
 * @author Bicho
 */
public class HibernateViajeDao extends HibernateGenericDAO<ViajeVO, Integer> implements ViajeDao{
    public HibernateViajeDao() {
        super(ViajeVO.class);
    }

    public List<ViajeVO> getAllOrderByDate() {
        DetachedCriteria detachedCriteria = DetachedCriteria.forClass(ViajeVO.class);
        detachedCriteria.addOrder(Order.desc("fingreso"));
        return listByCriteria(detachedCriteria);
    }
}
